package org.xxx.epms.models.epms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.xxx.epms.models.epms.model.GridProvince;
import org.xxx.epms.models.epms.mapper.GridProvinceMapper;
import org.xxx.epms.models.epms.service.GridProvinceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lb
 * @since 2024-06-08
 */
@Service
public class GridProvinceServiceImpl extends ServiceImpl<GridProvinceMapper, GridProvince> implements GridProvinceService {

    @Autowired
    private GridProvinceMapper provinceMapper;

    @Override
    public GridProvince getGridProvinceById(Integer provinceId) {
        QueryWrapper<GridProvince> wrapper = new QueryWrapper();
        wrapper.eq("province_id", provinceId);
        return provinceMapper.selectOne(wrapper);
    }

    @Override
    public List<GridProvince> getAllGridProvinces() {
        return provinceMapper.selectList(null);
    }

}
